# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidEnterprise.V1.Model.ProductPolicy do
  @moduledoc """
  The policy for a product.

  ## Attributes

  *   `autoInstallPolicy` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.AutoInstallPolicy.t`, *default:* `nil`) - The auto-install policy for the product.
  *   `autoUpdateMode` (*type:* `String.t`, *default:* `nil`) - The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.
  *   `enterpriseAuthenticationAppLinkConfigs` (*type:* `list(GoogleApi.AndroidEnterprise.V1.Model.EnterpriseAuthenticationAppLinkConfig.t)`, *default:* `nil`) - An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
  *   `managedConfiguration` (*type:* `GoogleApi.AndroidEnterprise.V1.Model.ManagedConfiguration.t`, *default:* `nil`) - The managed configuration for the product.
  *   `productId` (*type:* `String.t`, *default:* `nil`) - The ID of the product. For example, "app:com.google.android.gm".
  *   `trackIds` (*type:* `list(String.t)`, *default:* `nil`) - Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
  *   `tracks` (*type:* `list(String.t)`, *default:* `nil`) - Deprecated. Use trackIds instead.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoInstallPolicy => GoogleApi.AndroidEnterprise.V1.Model.AutoInstallPolicy.t() | nil,
          :autoUpdateMode => String.t() | nil,
          :enterpriseAuthenticationAppLinkConfigs =>
            list(GoogleApi.AndroidEnterprise.V1.Model.EnterpriseAuthenticationAppLinkConfig.t())
            | nil,
          :managedConfiguration =>
            GoogleApi.AndroidEnterprise.V1.Model.ManagedConfiguration.t() | nil,
          :productId => String.t() | nil,
          :trackIds => list(String.t()) | nil,
          :tracks => list(String.t()) | nil
        }

  field(:autoInstallPolicy, as: GoogleApi.AndroidEnterprise.V1.Model.AutoInstallPolicy)
  field(:autoUpdateMode)

  field(:enterpriseAuthenticationAppLinkConfigs,
    as: GoogleApi.AndroidEnterprise.V1.Model.EnterpriseAuthenticationAppLinkConfig,
    type: :list
  )

  field(:managedConfiguration, as: GoogleApi.AndroidEnterprise.V1.Model.ManagedConfiguration)
  field(:productId)
  field(:trackIds, type: :list)
  field(:tracks, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.ProductPolicy do
  def decode(value, options) do
    GoogleApi.AndroidEnterprise.V1.Model.ProductPolicy.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.ProductPolicy do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
